<div id="pan">
	<?php echo $html->link(__('Home',true), '/'); ?> &gt; 
	<?php echo $html->link(__('Article',true), array('controller'=>'articles')); ?> &gt; 
	<?php echo $html->link($article['Article']['title'], array('controller'=>'articles','action'=>'view',$article['Article']['id'])); ?> &gt;
	<strong><?php echo __('Edit',true); ?></strong>
</div>

<h2><?php echo __('Edit Article',true); ?></h2>
<?php echo $form->create('Article',array('action' => 'edit','dojoType'=>'dijit.form.Form'));?>
<?php echo $form->input('id'); ?>
<?php echo $form->hidden('user_id',array('value'=>$article['Article']['user_id'])); ?>
<div id="article_tabs" dojoType="dijit.layout.TabContainer" doLayout="false">
	<div dojoType="dijit.layout.ContentPane" title="<?php echo __('Main',true); ?>">
		<?php echo $form->hidden('user_id',array('value'=>$auth['User']['id'])); ?>
		<dl>
			<dt><?php echo __('Title',true); ?></dt>
			<dd><?php echo $form->text('title',array(
					'dojoType'=>'dijit.form.ValidationTextBox',
					'required'=>'true',
					'invalidMessage'=>__('Title is empty.',true)
				)); ?><span dojoType="dijit.Tooltip" connectId="ArticleTitle"><?php echo __('Please put in the music name of MML.',true); ?></span>
			</dd>
			<dt><?php echo __('Rank',true); ?></dt>
			<dd><?php echo $form->select('rank_id',
					array($ranks),$article['Article']['rank_id'],
					array(
						'dojoType'=>'dijit.form.FilteringSelect',
						'autocomplete'=>'false',
						'ignoreCase'=>'false',
						'hasDownAllow'=>'true',
						'style'=>'width:48px',
					),
				false); ?>
			</dd>
			<dt><?php echo __('Message',true); ?></dt>
			<dd>
				<div id="Editor" dojoType="dijit.Editor" plugins="['undo','redo','|','cut','copy','paste','|','bold','italic','underline','strikethrough','createLink',{name:'dijit._editor.plugins.EnterKeyHandling'},'|','foreColor','hiliteColor','|','justifyLeft','justifyCenter','justifyRight']" styleSheets="/css/editor.css" id="ArticleBody" ><?php echo $article['Article']['body']; ?></div>
				<?php echo $form->hidden('body',array('value'=>$article['Article']['body'])); ?>
				<span dojoType="dijit.Tooltip" connectId="Editor"><?php echo __('Please input your comment about this work.',true); ?><br /><?php echo __('When you starting a new line a new line, please press the return key, pressing the Shift key.',true); ?></span>
			</dd>
		</dl>
	</div>
	<div dojoType="dijit.layout.ContentPane" title="<?php echo __('Option',true); ?>">
		<dl>
			<dt><?php echo __('Page Name',true); ?></dt>
			<dd><?php echo $form->text('page_name',array(
					'dojoType'=>'dijit.form.ValidationTextBox',
					'RegExp'=>'[-_a-zA-Z0-9%]+$',
					'maxlength'=>'64',
					'invalidMessage'=>__('The character which can be used is only an alphanumeric character.',true)
				)); ?><span dojoType="dijit.Tooltip" connectId="ArticlePageName"><?php echo __('Here, the file name of a page is put in.',true); ?><br /><?php echo __('Not required.',true); ?></span>
			</dd>
			<dt><?php echo __('Source',true); ?></dt>
			<dd><?php echo $form->text('source',array(
					'dojoType'=>'dijit.form.TextBox',
					'maxlength'=>'128',
				)); ?><span dojoType="dijit.Tooltip" connectId="ArticleSource"><?php echo __('Please fill in the source origin of this MML (a composer name, a work name, etc.).',true); ?><br /><?php echo __('Not required.',true); ?></span>
			</dd>
			<dt><?php echo __('Tags',true); ?></dt>
			<dd><?php
				echo $form->text('tags',array(
					'dojoType'=>'dijit.form.TextBox',
					'required'=>'true',
					'style'=>'width:360px;'
				));
			?><span dojoType="dijit.Tooltip" connectId="ArticleTags"><?php echo __('Multiple tags have to be seperated with commas.',true); ?><br /><?php echo __('Not required.',true); ?></span>
			</dd>
			<dt><?php echo __('Lyrics',true); ?></dt>
			<dd><?php echo $form->textarea('lyrics',array(
					'dojoType'=>'dijit.form.Textarea',
					'style'=>'width:512px;',
				));
			?></dd><span dojoType="dijit.Tooltip" connectId="ArticleLyrics"><?php echo __('Please input, if there are the lyrics etc.',true); ?><br /><?php echo __('Not required.',true); ?></span>
		</dl>
	</div>
</div>
<div class="action">
	<button type="submit" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconSave"><?php echo __('Save',true) ?></button>
	<button type="reset" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconReset"><?php echo __('Reset',true) ?></button>&nbsp;
	<button id="cancel" dojoType="dijit.form.Button" iconclass="LoreleiIcon LoreleiIconCancel"><?php echo __('Cancel',true) ?></button>
</div>
<?php echo $form->end();?>

<?php 
$this->addScript($javascript->codeBlock('
dojo.require("dijit.form.Button");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.FilteringSelect");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Textarea");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dijit.Editor");
dojo.require("dijit._editor.plugins.EnterKeyHandling");
dojo.require("dijit._editor.plugins.TextColor");
dojo.require("dijit._editor.plugins.LinkDialog");
dojo.require("lorelei.articles");
var article_id = "'.$article['Article']['id'].'";
var user_id = "'.$article['Article']['user_id'].'";
var auth_id = "'.$auth['User']['id'].'";

lorelei.articles.form(\'ArticleEditForm\');
',array('inline' => false))); ?>